home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gold Medal Software 2
/
Gold Medal Software Volume 2 (Gold Medal) (1994).iso
/
prog
/
tdl400.arj
/
TDL400.MAN
< prev
next >
Wrap
Text File
|
1993-08-30
|
73KB
|
2,552 lines
TTTTT UU UU RRRR BBBB OOOOO
T UU UU R R B B O O
T UU UU RRRR BBBB O O
T UU UU R R B B O O
T UUU R RR BBBB OOOOO
DDDD EEEEE VV VV EEEEE LL OOOOO PPPP MMMMM EEEEE NNNNN TTTTT
D D E VV VV E LL O O P P M M M E N N T
D D EEEE VVV EEEE LL O O PPPP M M M EEEE N N T
D D E VVV E LL O O P M M E N N T
DDDD EEEEE V EEEEE LLLLL OOOOO P M M EEEEE N N T
LL IIIII BBBB RRRR AAA RRRR YY YY
LL I B B R R A A R R YY YY
LL I BBBB RRRR AAAAA RRRR YYY
LL I B B R R A A R R Y
LLLLL IIIII BBBB R RR A A R RR Y
VERSION 4.00 FOR BORLAND PASCAL 7.0
DOS MODE
(C) 1990-1993 Dan Consult / Software Productions, all rights reserved
┌──────────────────────────────────────────────────────────────────────────────┐
│ Turbo Development Library V. 4.00 Chapter 1 WELCOME │
└──────────────────────────────────────────────────────────────────────────────┘
Welcome to the most complete function and procedure library ever made for
Borland Pascal 7.0.
This is a collection with over 200 functions and procedures you can incorporate
in your own Borland Pascal 7.0 programs for the IBM and IBM-Compatible PC.
In addition to the unique functions TDL 4.0 also brings a different philosophy.
TDL 4.0 is written using as much inline assembler code as possible to make the
functions and procedures as fast and small as possible.
And TDL 4.0 is modular so that you don't have to use the entire package if you
only need one module.
Software Licence Statement.
---------------------------
This manual and software described in it are protected by international copy-
right laws. You still are allowed to make copies and distribute them as this
piece of software is shareware, as long as you do not alter the package in any
way. The functions and procedures described within this manual may not be used
in commercial programming without registration. When registrating, you are per-
mitted to distribute the programmes done with Borland Pascal 7.0 and Turbo
Development Library 4.0 royalty-free, and you don't need to mention TDL 4.0
anywhere in your programs, nor your manuals.
Requirements.
-------------
To include the Turbo Development Library 4.0 units into your Borland Pascal 7.0
programs, you must have the following:
■ An IBM, PS/1, PS/2, AT, 386, 486 or 100% compatible computer
■ Borland Pascal 7.0 installed on your harddisk
■ At least ½Mb of free hard disk space
■ Running MS-DOS 4.x and above
■ At least 512Kb free to run Borland Pascal 7.0
■ One 3.5" or 5.25" Double- or high density floppy drive
■ One monocrome or color monitor
If you run MS-DOS below version 4.0, or running another DOS (eg. DR-DOS) you
might have some troubles with some of the functions and procedures.
┌──────────────────────────────────────────────────────────────────────────────┐
│ Turbo Development Library V. 4.00 Chapter 2 INSTALLATION │
└──────────────────────────────────────────────────────────────────────────────┘
To install the function and procedures, simply unpack the archives in the main
package into your Borland Pascal 7.0 directory, using the LHA or LHARC programs.
The demos and examples may be unpacked into directories of your own taste, but
when altering and compiling them (or your own programs) you must remember to
set the DOS PATH to include the Borland Pascal 7.0 directory.
┌──────────────────────────────────────────────────────────────────────────────┐
│ Turbo Development Library V. 4.00 Chapter 3 UNIT TDCSL │
└──────────────────────────────────────────────────────────────────────────────┘
Function PrinterReady.
----------------------
Calling
Test:=PrinterReady : Boolean;
Purpose
Tests if the printer on LPT1 is ready to recieve data. If it is ready, this
function returns TRUE otherwise it will return FALSE.
Function ReadFromCom.
---------------------
Calling
ComChar:=ReadFromCom : Char;
Purpose
Waits on a character from COM1 and returns it when read.
Procedure SendToCom.
--------------------
Calling
SendToCom(Ch : Char);
Purpose
Sends the character Ch to COM1 port.
┌──────────────────────────────────────────────────────────────────────────────┐
│ Turbo Development Library V. 4.00 Chapter 4 UNIT TDLINE │
└──────────────────────────────────────────────────────────────────────────────┘
Function ReadFormStr.
---------------------
Calling
FormStr:=ReadFormStr(X, Y, Len : Integer; DefaultStr : String[80]) :
String[80];
Purpose
ReadFormStr is a formatted input function, asking for a string at the maxi-
mum length of Len at position X,Y. It writes the default string at that
position, and that may be altered using arrows, delete and backspace.
┌──────────────────────────────────────────────────────────────────────────────┐
│ Turbo Development Library V. 4.00 Chapter 5 UNIT TDEMS │
└──────────────────────────────────────────────────────────────────────────────┘
Function EMSInit.
-----------------
Calling
Error:=EMSInit(Var Address, Version : Word; Var FreePages : Integer) : Integer;
Purpose
This function is testing if an EMM-manager is present in memory and returns
the address and version of the EMM-manager (EMMxxxx0) in word and the free
16 Kb pages as an integer. The errorcode will hold the EMM error if something
is wrong, otherwise it will hold zero.
Function EMSAllocate.
---------------------
Calling
Error:=EMSAllocate(Pages : Integer; Var Handle : Word) : Integer;
Purpose
The function EMSAllocate will try to allocate the given 16 Kb pages and returns
the handle of those pages. Error will hold any possible EMM error.
Function EMSDeallocate.
-----------------------
Calling
Error:=EMSDeallocate(Handle : Word) : Integer;
Purpose
EMSDeallocate will deallocate the allocated EMS handle given in handle.
Function EMSMapPage.
--------------------
Calling
Error:=EMSMapPage(PhysPage, LogPage : Integer; Handle : Word) : Integer;
Purpose
After allocating the EMS pages you need to allocate the physical and logical
pages to use with that EMS handle. Error will hold any possible EMM error or
zero if nothing went wrong.
Function EMSGetUnallocatedPageCount.
------------------------------------
Calling
Error:=EMSGetUnallocatedPageCount(Var FreePages : Integer) : Integer;
Purpose
The function EMSGetUnallocatedPageCount will return the free pages not allo-
cated with EMSAllocate avaliable in your system, and return them in the integer
variable FreePages.
Function EMSSave.
-----------------
Calling
Error:=EMSSave(Handle : Word) : Integer;
Purpose
The function EMSSave will like the function EMSRestore be used with TSR and
multitasking systems. A TSR program will halt a running program and it will
sometimes also use the EMS in your system. This TSR program will call EMSSave
before exiting to be sure that the code allocated in EMS will still be avai-
lable when it pop up again.
Function EMSRestore.
--------------------
Calling
Error:=EMSRestore(Handle : Word) : Integer;
Purpose
This function restores EMS saved by the function EMSSave. It will like EMSSave
be used in TSR and multitasking programs.
Function EMSGetHandleCount.
---------------------------
Calling
Error:=EMSGetHandleCount(Var ActiveHandles : Integer) : Integer;
Purpose
EMSGetHandleCount returns in the variable ActiveHandles the free handles you
will be able to use for further EMS allocating.
Function EMSGetHandlePages.
---------------------------
Calling
Error:=EMSGetHandlePages(Handle : Word; Pages : Integer) : Integer;
Purpose
The function EMSGetHandlePages returns in the variable Pages the number of
pages allocated in the given Handle.
Function EMSGetAllHandlePages.
------------------------------
Calling
Error:=EMSGetAllHandlePages(Var HandleArr : HandlePageArr; Var Handles :
Integer) : Integer;
Purpose
The function EMSGetAllHandlePages returns the number of allocated handle-
pages and the page numbers in HandleArr.
Function EMSGetPageMap.
-----------------------
Calling
Map:=EMSGetPageMap(PageMap : Pointer) : Integer;
Purpose
EMSGetPageMap returns a pointer to the actual EMM PageMap in your memory.
Function EMSSetPageMap.
-----------------------
Calling
Map:=EMSSetPageMap(PageMap : Pointer) :Integer;
Purpose
EMSSetPageMap loaded the EMM-manager with an actual EMM PageMap returned
with the function EMSGetPageMap.
Function EMSSwapPageMap.
------------------------
Calling
Swap:=EMSSwapPageMap(Target, Source : Pointer) : Integer;
Purpose
EMSSwapPageMap is a combination between then functions EMSGetPageMap and
EMSSetPageMap. It is swapping the EMM condition in the pointer Target to
the EMM condition in the pointer Source.
Function EMSGetPageMapSize.
---------------------------
Calling
Size:=EMSGetPageMapSize(var Size : Word) : Integer;
Purpose
EMSGetPageMapSize returns the size of the actual EMM conditions. This
function must be called before using the functions EMSGetPageMap and
EMSSwapPageMap, so the used memory space can be detected.
Function EMSGetParticalPageMap.
-------------------------------
Calling
PartMap:=EMSGetParticalPageMap(Page, Condition : Pointer) : Integer;
Purpose
This function saves the condition of the given page. The size to save must
be given with the function EMSGetSizeParticalPageMap. The Pointer Page
points to a structure, containing a word with the numbers of following
physical segment addresses, and secondly the segment address.
The Pointer Condition points of the memory adress, where the EMM manager
can place the informations.
Function EMSSetParticalPageMap.
-------------------------------
Calling
PartMap:=EMSSetParticalPageMap(Condition : Pointer) : Integer;
Purpose
The function EMSSetParticalPageMap is used to set the condition before
using the function EMSGetParticalPageMap.
Function EMSGetSizeParticalPageMap.
-----------------------------------
Calling
Size:=EMSGetSizeParticalPageMap(Pages : Integer; Var Size : Word) : Integer;
Purpose
EMSGetSizeParticalPageMap returns the size of the given page in bytes.
Function EMSMapMultipleHandlePagesPage.
---------------------------------------
Calling
Error:=EMSMapMultipleHandlePagesPage(Numbers, Handle : Word; Page : Pointer)
: Integer;
Purpose
This function maps multiple, logical pages. It returns a pointer Page poin-
ting to an array of the following structure:
- 2 bytes logical page
- 2 bytes physical page
Function EMSMapMultipleHandlePagesSegment.
------------------------------------------
Calling
Error:=EMSMapMultipleHandlePagesSegment(Numbers, Handle : Word; Segment :
Pointer ) : Integer;
Purpose
EMSMapMultipleHandlePagesSegment works almost as the function EMSMapMultiple-
HandlePages, but the two last bytes will here not hold the physical page
but the segment address on the logical page.
Function EMSReallocatePages.
----------------------------
Calling
Error:=EMSReallocatePages(Var NewPages : Integer; Handle : Word) : Integer;
Purpose
EMSReallocatePages reallocate allocated pages. Var NewPages are used for
further reference to the pages at that EMM Handle.
Function EMSGetHandleAttribut.
------------------------------
Calling
Error:=EMSGetHandleAttribut(Handle : Word; Var Attribut : Integer) : Integer;
Purpose
EMSGetHandleAttribut returns the attribute of the EMM Handle. This attribut
can be reset protected or not reset protected. A reset protected Handle
will still exist when the computer is resetted using CTRL-ALT-DEL. That
can be e.g. RAM-Disks that works with expanded memory.
Function EMSSetHandleAttribut.
------------------------------
Calling
Error:=EMSSetHandleAttribut(Handle : Word; Attribut : Integer) : Integer;
Purpose
EMSSetHandleAttribut sets the attribut of the EMM Handle.
See also EMSGetHandleAttribut.
Function EMSGetHandleAttributCapability.
----------------------------------------
Calling
Error:=EMSGetHandleAttributCapability(Var Attribut : Integer) : Integer;
Purpose
EMSGetHandleAttributCapability tested if the EMM Manager in your system
supports the reset protedted EMM mode.
Function EMSGetHandleName.
--------------------------
Calling
Error:=EMSGetHandleName(Handle : Word; Name : HandleName) : Integer;
Purpose
EMSGetHandleName returns the given name of the EMM Handle.
HandleName is defined as follows:
Type HandleName = Array[1..8] Of Char;
Function EMSSetHandleName.
--------------------------
Calling
Error:=EMSSetHandleName(Handle : Word; Name : HandleName) : Integer;
Purpose
EMSSetHandleName sets the name of the given EMM handle.
Function EMSGetHandleDirectory.
-------------------------------
Calling
Error:=EMSGetHandleDirectory(Dir : Pointer; Var Handle : Word) : Integer;
Purpose
The function EMSGetHandleDirectory returns all handles with names. It is
placed in memory where Dir points to, in an array with the following struc-
ture: - 2 bytes Handle
- 8 Bytes Handle Name
The free memory for that structure must be at least 225 * (2 + 8) bytes =
2550 bytes, when a maximum of 225 EMM Handles are supported.
Function EMSSearchNamedHandle.
------------------------------
Calling
Error:=EMSSearchNamedHandle(Name : HandleName ; Var Handle : Word) : Integer;
Purpose
EMSSearchNamedHandle will search for an EMM Handle with the given Name.
Function EMSGetTotalHandles.
----------------------------
Calling
Error:=EMSGetTotalHandles(Var Handle : Word) : Integer;
Purpose
EMSGetTotalHandles will return the total of allocated handles in the Var
Handle.
Function EMSJmp.
----------------
Calling
Error:=EMSJmp(Handle : Word; PageSegment : Integer; Pages : JmpStru) :
Integer;
Purpose
EMSJmp will jump to the given place in your memory and continue to execute
the running program. This function is suitable when your program will exe-
cute a code located in expanded memory.
JmpStru is defined as follows:
Type JmpStru = Record
Address : Pointer;
NumIn : Byte; {Number of calls}
PointIn : ^MapStru; {4 byte pointer to MapStru}
End;
MapStru is defined as follows:
Type MapStru = Record
LogPage : Word; {Number of logical page}
PhysPage : Word; {Number of physical page}
End;
Function EmsCall.
-----------------
Calling
Error:=EMSCall(Handle : Word; PageSegment : Integer; Pages : CallStru) :
Integer;
Purpose
EMSCall will call the given place in your memory and execute it. When
finished it will return to where you left your main progra, This will be
suitable for sub-programs or -routines.
CallStru is defined as follows:
Type CallStru = Record
Address : Pointer;
NumIn : Byte;
PointIn : ^MapStru;
TargetType : Byte; {Number of arrays for the
sub-program}
TargetPointIn : ^MapStru;
End;
Function EMSMoveExchangeMemory.
-------------------------------
Calling
Error:=EMSMoveExchangeMemory(MoveExch : Integer; Struct : EMSMoveStru) :
Integer;
Purpose
EMSMoveExchangedMemory will exchange the given memory. It works both in con-
ventional memory and in expanded.
EMSMoveStru is defined as follows:
Type EMSMoveStru = Record
Len : LongInt;
SourceType : Byte; {Memorytype conventional or
expanded}
SourceHandle : Word;
SourceOffset : Word;
SourceSegment : Word;
TargetType : Byte;
TargetHandle : Word;
TargetOffset : Word;
TargetSegment : Word;
End;
Function EMSGetMappablePhyAdressArray.
--------------------------------------
Calling
Error:=EMSGetMappablePhyAdressArray(Struct : Pointer; Var Entries : Integer)
: Integer;
Purpose
The function EMSGetMappablePhyAdressArray returns in memory an array with all
the physical pages. Before calling EMSGetMappablePhyAdressArray, the function
EMSGetMappableEntriesPhyAdressArray must be called, to fix the size of the
used handles.
This function returns in Var Entries the numbers of positions in the memory
array that are legal handle adresses.
The memory array, where Struct points to, will be an array of the following
structure: - 2 bytes with segmentaddress of the physical page
- 2 bytes page number of the physical page
Function EMSGetMappableEntriesPhyAdressArray.
---------------------------------------------
Calling
Error:=EMSGetMappableEntriesPhyAdressArray(Var Entries : Integer) : Integer;
Purpose
EMSGetMappableEntriesPhyAdressArray returns the number of entries for use
with EMSGetMappablePhyAdressArray. This number must be returned four times
(every array position uses four bytes) to fix the total memoryusage.
Function EMSPrepareWarmBoot.
----------------------------
Calling
Error:=EMSPrepareWarmBoot : Integer;
Purpose
The function EMSPrepareWarmBoot will prepare your system for a warm boot
(CTRL-ALT-DEL) to make sure the reset protected handles will be avaliable
after a system warm boot.
┌──────────────────────────────────────────────────────────────────────────────┐
│ Turbo Development Library V. 4.00 Chapter 6 UNIT TDCRT │
└──────────────────────────────────────────────────────────────────────────────┘
Procedure FastCenter.
---------------------
Calling
FastCenter(Y, ForeGr, BackGr : Integer; St : String);
Purpose
FastCenter will center the string St on the screen
coordinate (39-Length(St) Div 2, Y). Therefore Length
(St) must be in the range 1-80. The string will be
written in the colors ForeGr (ForeGround) and BackGr
(BackGround).
Notice: The screen width is assumed to be 80 chars.
Example
Program Exam1;
Uses TdCrt,
Begin
FastCenter(10, 7, 0, 'Hello World!');
End.
Procedure FastWrite.
--------------------
Calling
FastWrite(X, Y, ForeGr, BackGr : Integer; St : String);
Purpose
FastWrite will write the string St on the screen
coordinates given in integer S and Y, in the color
ForeGr (ForeGround) and BackGr (BackGround). This
procedure will work 50-80% faster than GotoXY and
Write.
Example
Program Exam2;
Uses TdCrt;
Begin
FastWrite(10, 10, 7, 0, 'Hello World!');
End.
Function FindVideoAdr.
----------------------
Calling
Adr:=FindVideoAdr : Word;
Purpose
FindVideoAdr will return the address (either $B000 or
$B800) where your displayadaptor uses memory to store
the screen. This will come handy when copying the video
memory to EMS or disk, The procedures FastWrite,
FastCenter, PW and PWLn are writing direct to that
address.
Notice: FindVideoAdr is identical with the function
GetVideoMemory, but this will work abour 10% faster.
Example
Program Exam3;
Uses TdCrt;
Var Adr : Word;
Begin
Adr:=FindVideoAdr;
Writeln('Video stored at: $',ToHex(Adr));
End.
Procedure GetKeyStatus.
-----------------------
Calling
GetKeyStatus(Var Ins, CapsLock, NumLock, ScrollLock,
Alt, Ctrl, LeftShift, RightShift : Boolean);
Purpose
GetKeyStatus will get the status as a boolean variable
for the keys: Ins, CapsLock, NumLock, ScrollLock, Alt,
Ctrl, LeftShift and RightShift. Is the key is pressed,
the variable will return TRUE otherwise FALSE.
Function FillString.
--------------------
Calling
St:=FillString(FillCh : Char; L : Word);
Purpose
FillString will return a string variable containing L
characters of the character FillCh. The number L must
be less than 256, because this function is not
supported by Turbo Development Library BigStrings.
Example
Program Exam4;
Uses TdCrt;
Var St : String;
Begin
St:=FillString('*', 80);
Writeln('Here comes 80 times *');
Writeln(St);
End.
Function GetVideoMemory.
------------------------
Calling
Memory:=GetVideoMemory : Word;
Purpose
See "Function FindVideoAdr."
FindVideoAdr and GetVideoMemory are identical, but
FindVideoAdr is about 10% faster.
Function GetYesNo.
------------------
Calling
Answer:=GetYesNo : Boolean;
Purpose
The function GetYesNo will return TRUE if the key y or
Shift-y is pressed. It will return FALSE if the key n
or Shift-n is pressed. No other keys will affect this
function.
Example
Program Exam5;
Uses TdCrt;
Begin
Writeln('Do you want tp continue ? [Y/N]');
If GetYesNo = FALSE Then
Begin
Writeln('OK. Halting program.');
Halt;
End;
Writeln('Continuing program.');
End.
Function IsBitOn.
-----------------
Calling
Test:=IsBitOn(Position, TestByte : Byte) : Boolean;
Purpose
IsBitOn will test the byte testByte for the bit
Position. If Position is set, IsBitOn will returb TRUE,
otherwise it will return FALSE.
Example
Program Exam6;
Uses TdCrt;
Var Test : Boolean;
Begin
Test:=IsBitOn(4,255);
Write('Bit 4 in 255 is ');
If Test Then
Writeln('ON') Else
Writeln('OFF');
Test:=IsBitOn(4,0);
Write('Bit 4 in 0 is ');
If Test Then
Writeln('ON') Else
Writeln('OFF');
End.
Procedure PW.
-------------
Calling
PW(X, Y : Byte; St : String);
Purpose
PW will position and write the string St at position X,
Y. This is done by using direct memory writing, like
FastCenter and FastWrite. Therefore PW is much faster
than GotoXY and Write.
PW will write St in the current foreground- and
background colors.
Procedure PWLn.
---------------
Calling
PWLn(X, Y : Byte; St : String);
Purpose
See "Procedure PW."
Notice: PWLn will write St and a new line like GotoXY
and Writeln, but still much faster.
Function ReadKeyCode.
---------------------
Calling
GetCode:=ReadKeyCode : Word;
Purpose
ReadKeyCode will return the extended key-code for the
pressed key-combination.
Example
Program Exam7;
Uses TdCrt;
Var KCode : Word;
Begin
Writeln('Press any Key-Combination.');
KCode:=ReadKeyCode;
Writeln('KeyCode is: $',ToHex(KCode));
End.
Function ReadScreenChar.
------------------------
Calling
Ch:=ReadScreenChar(X, Y : Byte) : Char;
Purpose
ReadScreenChar will read the ANSI-character written at
position X, Y and return it as a char-variable.
Procedure Scroll.
-----------------
Calling
Scroll(Chars : Integer; X1, Y1, X2, Y2, Color : Byte);
Purpose
Scroll will scroll your text-screen Chars characters
either up (Chars is negative) or down (Chars is
positive). It will work in the window (X1, Y1) - (X2,
Y2) and in the selected color.
Procedure SetBit.
-----------------
Calling
SetBit(Position, Value : Byte; Var ChangeByte : Byte);
Purpose
SetBit will set (or reset) the bit at Position in the
variable ChangeByte to the value in Value. Value must
be either 1 (set) or 0 (reset).
Example
Program Exam8;
Uses TdCrt;
Var TestByte : Byte;
Begin
TestByte:=0;
Writeln('Bit 4 in ',TestByte,' is on: ',IsBitOn(4, TestByte));
SetBit(4, 1, TestByte);
Writeln('Bit 4 in ',TestByte,' is on: ',IsBitOn(4, TestByte));
End.
Function SpaceOut.
------------------
Calling
St:=SpaceOut(St1 : String; L : Word) : String;
Purpose
SpaceOut will make a string Length L, copy St1 onto it
and fill the remaining places with a space (Chr(32)).
Function Sum.
-------------
Calling
AB:=Sum(A, B : Integer) : Integer;
Purpose
Sum will return the addition of the two given integers
about 50% faster than a normal addition (AB:=A+B).
Function ToHex.
---------------
Calling
Hex:=ToHex(W : Word) : String;
Purpose
ToHex will convert the word W to a string containng the
Hex-value af the word.
Example
Program Exam9;
Uses TdCrt;
Begin
Writeln('Converting 597 to hex: $',ToHex(597));
End.
Function UpString.
------------------
Calling
St:=UpString(St1 : String) : String;
Purpose
UpString will convert every char in the string St1 to
their equal upper case letter.
Notice: UpString will only have effect on strings
containing chars in the range from 'a' to 'z'.
Example
Program Exam10;
Uses TdCrt;
Var St1 : String;
Begin
Write('Enter a String : ');
Readln(St1);
Writeln(St1);
Writeln(UpString(St1));
End.
Function WaitKey.
-----------------
Calling
Test:=WaitKey : Boolean;
Purpose
Halts your program execution until you press any key on
your keyboard.
Example
Program Exam11;
Uses TdCrt;
Begin
Writeln('Press any key...');
If WaitKey Then;
Writeln('Thanks.');
End.
┌──────────────────────────────────────────────────────────────────────────────┐
│ Turbo Development Library V. 4.00 Chapter 7 UNIT TDIO │
└──────────────────────────────────────────────────────────────────────────────┘
Procedure Beep.
---------------
Calling
Beep;
Purpose
Performs a bell-sound in your PC speaker.
Procedure BigCursor.
--------------------
Calling
BigCursor;
Purpose
Turns your text cursor into a block. That makes it very easy to see.
Procedure DBox.
---------------
Calling
DBox(X1, Y1, X2, Y2 : Integer; Header : String);
Purpose
DBox draws a double lined box on the screen from the coordinates X1,Y1 to
X2,Y2 and put on the title given in Header.
Procedure FillScreen.
---------------------
Calling
FillScreen(Ch : Char);
Purpose
FillScreen will fill the whole text screen with the character given in Ch.
Procedure HideCursor.
---------------------
Calling
HideCursor;
Purpose
HideCursor will make the text cursor disappear. It will only be the physical
part of the cursor that will disappear. You will still be able to do cursor
related operations with no cursor seen on the screen.
Procedure MoveFromScreen.
-------------------------
Calling
MoveFromScreen(Var Source, Dest; Len : Integer);
Purpose
Moves data from the video buffer. Source will be the actual color video
buffer.
Remember to set Len that there are two bytes for each character. For an
entite screen Len would be 4000.
Procedure MoveToScreen.
-----------------------
Calling
MoveToScreen(Var Source, Dest; Len : Integer);
Purpose
Moves data back from memory to the video buffer. Still remember to setting Len
to two times the number og chars you want to move.
Function ReadChFromScr.
-----------------------
Calling
Ch:=ReadChFromScreen(X, Y : Integer) : Char;
Purpose
ReadChFromScreen reads the character at the screen coordinates X,Y and returns
it in Ch. If no character found at the given coordinates Ch will hold a space
(Chr(32)).
Function ReadStFromScr.
-----------------------
Calling
Str:=ReadStFromScr(X, Y, Len : Integer) : String;
Purpose
ReadStFromString returns the characters found on screen coordinate X,Y and Len
characters forward and returns them in a string format in the variable Str.
Procedure RecallScreen.
-----------------------
Calling
RecallScreen(Number : Integer);
Purpose
RecallScreen will restore the screencontents stored in Number onto the video
memory. Number must be in the range from 0 to 5. No more screens are allowed
to be stored in the memory.
Procedure RecallWindow.
-----------------------
Calling
RecallWindow(X1, Y1, X2, Y2 : Integer);
Purpose
RecallWindow will restore the screencontents of the window in the screen coor-
dinates X1,Y1 to X2,Y2 onto the video memory.
Procedure RepeatCh.
-------------------
Calling
RepeatCh(Ch : Char; X, Y, Num : Integer);
Purpose
RepeatCh will write the character Ch Num times on the screen starting in the
coordinates X,Y.
Procedure SaveScreen.
---------------------
Calling
SaveScreen(Number : Integer);
Purpose
Stores the screen contents into your memory and giving it Number. Please only
use numbers from 0 to 5. No more screens are allowed to be stored in your
memory.
Procedure SaveWindow.
---------------------
Calling
SaveWindow(X1, Y1, X2, Y2 : Integer);
Purpose
Saves the contents of the screen area at the coordinates from X1,Y1 to X2,Y2
into your memory.
Procedure SBox.
---------------
Calling
SBox(X1, Y1, X2, Y2 : Integer; Header : String);
Purpose
SBox draws a single lined box on the screen from the coordinates X1,Y1 to
X2,Y2 and put on the title given in Header.
Procedure SetColor.
-------------------
Calling
SetColor(ForeGr, BackGr : Integer);
Purpose
SetColor sets the default colors to ForeGr as foreground color and BackGr as
background color.
Procedure ShowCursor.
---------------------
Calling
ShowCursor;
Purpose
Makes the cursor visible on the current X,Y screen coordinates.
Procedure SmallCursor.
----------------------
Calling
SmallCursor;
Purpose
Turns the text cursor into a single line to make it as small as possible.
Procedure WriteCh.
------------------
Calling
WriteCh(Ch : Char; X, Y : Integer);
Purpose
WriteCh writes a character in the current colors on the screen coordinates X,Y
using very fast assembler coding.
Procedure WriteChLn.
--------------------
Calling
WriteChLn(Ch : Char; X, Y : Integer);
Purpose
WriteChLn works as WriteCh but finishes with an carriage return and line feed.
Procedure WriteSt.
------------------
Calling
WriteSt(St : String; X, Y : Integer);
Purpose
WriteSt writes a string in the current colors on the screen coordinates X,Y
using very fast assembler coding.
Procedure WriteStLn.
--------------------
Calling
WriteStLn(St : String; X, Y : Integer);
Purpose
WriteStLn works as WriteSt but finishes with and carriage return and line
feed.
┌──────────────────────────────────────────────────────────────────────────────┐
│ Turbo Development Library V. 4.00 Chapter 8 UNIT TDDIR │
└──────────────────────────────────────────────────────────────────────────────┘
Procedure ShowDir.
------------------
Calling
ShowDir;
Purpose
ShowDir prints a directory of files from the current logged path.
Files are displayed 6 to a line in horizontal format. The maximum number
of files that can be displayed is 120.
Procedure AskNewPath.
---------------------
Calling
AskNewPath;
Purpose
AskNewPath allows the user to change the current path by entering a new
drive/directory. AskNewPath does not display a directory of files so use
ShowDir to display the files in the changed directory.
Function GetFileFromDir.
------------------------
Calling
PickFile:=GetFileFromDir : String[80];
Purpose
GetFileFromDir returns a user-selected filename. The function displays a
directory of the current logged drive and allows the user to pick the file
using a point-and-shoot reverse-video cursor. The user may change path
during the selection by hitting the F2 key.
┌──────────────────────────────────────────────────────────────────────────────┐
│ Turbo Development Library V. 4.00 Chapter 9 UNIT TDMOUSE │
└──────────────────────────────────────────────────────────────────────────────┘
┌──────────────────────────────────────────────────────────────────────────────┐
│ NB: TDMOUSE WILL WORK IN GRAPHICS MODE AS WELL AS IN TEXT MODE. │
└──────────────────────────────────────────────────────────────────────────────┘
Function FindMouseX.
--------------------
Calling
X:=FindMouseX : Word;
Purpose
FindMouseX returns the X-coordinate where the mouse cursor is placed on the
screen.
Function FindMouseY.
--------------------
Calling
Y:=FindMouseY : Word;
Purpose
FindMouseY returns the Y-coordinate where the mouse cursor is placed on the
screen.
Procedure HideMouse.
--------------------
Calling
HideMouse;
Purpose
HideMouse makes the mouse cursor disappear from the screen.
Function InitMouse.
-------------------
Calling
Test:=InitMouse : Boolean;
Purpose
InitMouse is used to initialize the mouse driver. If no mouse driver is found,
InitMouse will return FALSE.
Function MouseInBox.
--------------------
Calling
Test:=MouseInBox(X1, Y1, X2, Y2) : Boolean;
Purpose
MouseInBox tests if the mouse is inside the given screen coordinates. If not
the function will return FALSE otherwise TRUE.
Procedure MouseMotion.
----------------------
Calling
MouseMotion(Horiz, Vert : Byte);
Purpose
MouseMotion sets the motion and sensibility of the mouse in both the
horizontal and the vertical way.
Procedure MouseWindow.
----------------------
Calling
MouseWindow(X1, Y1, X2, Y2 : Word);
Purpose
MouseWindow defines the window on the screen (from coordinate X1,Y1 to coordi-
nate X2,Y2) where the mouse can't come outside. Default is the whole screen
area.
Procedure PosMouse.
-------------------
Calling
PosMouse(X, Y : Word);
Purpose
PosMouse positions the mouse cursor at the screen coordinate X,Y.
Procedure ShowMouse.
--------------------
Calling
ShowMouse;
Purpose
ShowMouse shows the mouse cursor at the current mouse screen coordinates if
the mouse driver is succesfully initialized.
Function TestButton.
--------------------
Calling
Button:=TestButton : Byte;
Purpose
TestButton tests if any of the mouse buttons are pressed.
Returns 0 : No buttons pressed
1 : Left button prerssed
2 : Right button pressed
4 : Middle button pressed (only 3-button mouse)
┌──────────────────────────────────────────────────────────────────────────────┐
│ Turbo Development Library V. 4.00 Chapter 10 UNIT TDSWAP │
└──────────────────────────────────────────────────────────────────────────────┘
Procedure SwapB.
----------------
Calling
SwapB(Var B1, B2 : Byte);
Purpose
Swapping the two bytes B1 and B2 very fast.
Procedure SwapI.
----------------
Calling
SwapI(Var I1, I2 : Integer);
Purpose
Swapping the two integers I1 and I2 very fast.
Procedure SwapL.
----------------
Calling
SwapL(Var L1, L2 : LongInt);
Purpose
Swappin the two long-integers L1 and L2 very fast.
Procedure SwapW.
----------------
Calling
SwapW(Var W1, W2 : Word);
Purpose
Swapping the two words W1 and W2 very fast.
┌──────────────────────────────────────────────────────────────────────────────┐
│ Turbo Development Library V. 4.00 Chapter 11 UNIT TDTIMER │
└──────────────────────────────────────────────────────────────────────────────┘
Procedure StartTimer.
---------------------
Calling
StartTimer;
Purpose
StartTimer starts a background timer and sets the time to zero. Operations
can be done while the timer is still running.
Function StopTimer.
-------------------
Calling
Time:=StopTimer : Real;
Purpose
StopTimer stops the background timer and returns the seconds in the variable
Time.
┌──────────────────────────────────────────────────────────────────────────────┐
│ Turbo Development Library V. 4.00 Chapter 12 UNIT TDPRINT │
└──────────────────────────────────────────────────────────────────────────────┘
Procedure DumpScreen.
---------------------
Calling
DumpScreen;
Purpose
Sends a copy of the current text screen to the printer attashed to LPT1.
Works like striking the Print Screen key.
Procedure Print.
----------------
Calling
Print(St : String);
Purpose
Sends the string St onto the line printer attashed to LPT1.
Procedure PrintLn.
------------------
Calling
PrintLn(St : String);
Purpose
Works as Print but finishes with a carriage return and a line feed.
┌──────────────────────────────────────────────────────────────────────────────┐
│ Turbo Devlopment Library V. 4.00 Chapter 13 UNIT TDDOS │
└──────────────────────────────────────────────────────────────────────────────┘
Function CalculateDriveNumber.
------------------------------
Calling
Num:=CalculateDriveNumber(Dr : Char) : Byte;
Purpose
CalculateDriveNumber returns the number equal to the drive letter
given in Dr. Dos uses the DriveNumber for all of its disk operations.
Example
Program Exam12;
Uses TdDos;
Begin
Writeln('Drive A: has no.: ',CalculateDriveNumber('A'));
End.
Function CheckDrive.
--------------------
Calling
Test:=CheckDrive(Dr : Char) : Byte;
Purpose
CheckDrive checks the given Drive in Dr and returns:
0 : Drive is OK.
1 : Illegal drive letter.
2 : Drive is not ready.
3 : Drive with error.
Function CheckPath.
-------------------
Calling
Test:=CheckPath(Path : String) : Boolean;
Purpose
CheckPath checks the existens of the given Path, f.ex.
C:\TP6\TDDEMOS. It will return TRUE if the given path is found,
otherwise it will return FALSE.
Function DisableDrive.
----------------------
Calling
Test:=DisableDrive(Dr : Char) : Boolean;
Purpose
DisableDrive will attempt to disable the given drive in Dr, and
return TRUE if succeded.
Notice: After you have succesfully disabled a drive, Dos will no
longer recognise it, and you need to enable it again or reset your
computer to gain contact with that drive again.
Notice: Do never try to disable the drive, you are currently wor-
king with.
Function DiskSectorsRead.
-------------------------
Calling
Test:=DiskSectorsRead(Dr : Word; FirstSec : LongInt; NumSec : Word;
Var Buffer) : Boorlan;
Purpose
DiskSectorsRead will read NumSec sectors from FirstSec on drive Dr into
Var Buffer. Remember to set the Buffer as an Array of Byte, and remember
to check how many bytes your sectors contains. That is normally 512 bytes
per sector, but can vary from device to device.
Example
Program Exam13;
Uses TdDos;
Var Buffer : Array[1..1024] Of Byte;
Test : Boolean;
Begin
Test:=DiskSectorsRead(0,0,2,Buffer);
End.
Function DiskSectorsWrite.
--------------------------
Calling
Test:=DiskSectorsWrite(Dr : Word; FirstSec : LongInt; NumSec : Word;
Var Buffer) : Boolean;
Purpose
DiskSectorsWrite will write the information in Var Buffer on NumSec Sec-
tors from FirstSec on drive Dr. An error will set Test to FALSE. Any pos-
sible error may be Illegal Drive, No Sectors, Unformatted Disk, DiskError,
No Disk In Drive and so on.
Function DriveIs.
-----------------
Calling
Drive:=DriveIs : Char;
Purpose
DriveIs will return the DriveLetter of the current drive.
Example
Program Exam14;
Uses TdDos;
Begin
Writeln('Current Drive Is ',DriveIs,':');
End.
Function EnableDrive.
---------------------
Calling
Test:=EnableDrive(Dr : Char) :Boolean;
Purpose
EnableDrive will attempt to enable a disabled drive. When you Disable a
drive, you only tell Dos, that the drive is no longer valid. The BIOS
will still know it is there. EnableDrive will force the BIOS to tell
Dos that the srive still is valid, and is it succeed, Dos will recognice
that drive again.
Function GetDosDataArea.
------------------------
Calling
Point:=GetDosDataArea : Pointer;
Purpose
GetDosDataArea will return a pointer to the Address where Dos starts
to store its datas.
Function GetFatInfo.
--------------------
Calling
Test:=GetFatInfo(Dr : Char; Var NOA, SPA, SS : Word) : Boolean;
Purpose
GetFatInfo returns TRUE if succeeded on the drive Dr, and then the Var
NOA will hold Number Of Allocated Units, SPA will hold Sectors Per Allo-
cated Unit and SS will hold the Size Of Sector in bytes.
Example
Program Exam15;
Uses TdDos;
Var NOS, SPA, SS : Word;
Test : Boolean;
Begin
Test:=GetFatInfo('C', NOA, SPA, SS);
If Test Then
Begin
Writeln('Number Of Allocated Units : ',NOA);
Writeln('Sectors Per Allocated Unit : ',SPA);
Writeln('Size Of Sector in bytes : ',SS);
Halt;
End;
Writeln('Illegal Drive.');
End.
Function GetFreeDiskSpace.
--------------------------
Calling
Test:=GetFreeDiskSpace(Dr : Char; Var Space : LongInt) : Boolean;
Purpose
GerFreeDiskSpace checks the drive Dr and returns TRUE if found. If
TRUE, the Var Space will hold the free space on the disk in bytes.
Function GetInfoOnDisk.
-----------------------
Calling
Test:=GetInfOOnDisk(Dr : Char; Var TC, CA, SPC, BPS, TU, TF : LongInt)
: Boolean;
Purpose
GetInfoOnDisk is an extended version of GetFatInfo. GetInfoOnDisk returns
all the information, you could come across when using f.x. sector copy-
ing on a disk. If Test is TRUE then Var TC will hold Total Clusters, CA
will hold Clusters Available, SPC will hold Sectors Per Cluster, BPS will
hold Bytes Per Sector, TU will hold Total Used and TF will hold Total
Free.
Procedure GetIntVector.
-----------------------
Calling
GetIntVector(Number : Word; Var Vec : Pointer);
Purpose
See the Borland Pascal 7.0 Manual for the purpose and description of the
procedure GetIntVec. GetIntVector is equal to that, but is 50% faster.
Function GetMemorySize.
-----------------------
Calling
Test:=GetMemorySize(Var Memory : LongInt) : Boolean;
Purpose
GetMemorySize will return your current memory size in Var Memory if Test
is set to TRUE.
Example
Program Exam16;
Uses TdDos;
Var Memory : LongInt;
Begin
If NOT GetMemorySize(Memory) Then
Begin
Writeln('Error. Halting.');
Halt;
End;
Writeln('Memory Size : ',Memory);
End.
Function GetRealDrives.
-----------------------
Calling
Drives:=GetRealDrives : Byte;
Purpose
GetRealDrives returns the number of real drives attached to your system.
Function GetRemainingFiles.
---------------------------
Calling
Files:=GetRemainingFiles : Integer;
Purpose
GetRemainingFiles returns the number of files, you still are allowed to
open, referred to your CONFIG.SYS line FILES=??.
Function GetSystemUpstartTime.
------------------------------
Calling
Test:=GetSystemUpstartTime(Vat SUTime : DateTime) : Boolean;
Purpose
GetSystemUpstartTime returns TRUE if the function is able to find the
time. If TRUE, the upstart time is stored in a DateTime record, there-
fore you must specify DOS in your USES line, f.ex:
USES TdDos, DOS, ...
Function GetVolLabel.
---------------------
Calling
Test:=GetVolLabel(Dr : Char; Var VL : String) : Boolean;
Purpose
Returns the volume label on a disk formatted using MS-DOS 4.X or higher.
If it is not able to find a volume label on the specified drive Dr, it
returns FALSE.
Procedure FillRegisters.
------------------------
Calling
FillRegisters(Var Regs : Registers);
Purpose
FillRegisters will fill all the registers with a zero, for preparing them
for use with DOS / BIOS calls. 80% of all the functions and procedures in
Turbo Development Library uses FillRegisters.
Notice: This also needs DOS.TPU in your USES-line.
Function IsDRDOS.
-----------------
Calling
TestDOS:=IsDRDOS : Boolean;
Purpose
IsDRDOS is a little trace function, working with only some versions of DR
/ MS DOS. It returns TRUE is DR-DOS is installed, and FALSE if not.
Example
Program Exam17;
Uses TdDos;
Begin
WriteLn('DR-DOS is running: ',IsDRDOS);
End.
Procedure GetDiskUsage.
-----------------------
Calling
GetDiskUsage(Dr : Char; Var DFree, DUsed, DToral : LongInt);
Purpose
GetDiskUsage returns same informations about the disk in the drive Dr. The
variable DFree will hold the free unused disk space in bytes, DUsed will
hold the used disk space in bytes and DTotal will hold the total disk
capasity in bytes.
Example
Program Exam18;
Uses TdDos;
Var DFree, DUsed, DTotal : LongInt;
Begin
GetDiskUsage(DriveIs, DFree, DUsed, DTotal);
Writeln('Info on current drive: ',DriveIs);
Writeln('Free bytes : ',DFree);
Writeln('Used bytes : ',DUsed);
Writeln('Total bytes : ',DTotal);
End.
Function MakeFile.
------------------
Calling
Test:=MakeFile(Name : String) : Boolean;
Purpose
MakeFile will create and close an empty file. If Test returns FALSE
something has gone wrong, eg. writeprotected disk or no disk in drive.
Procedure SetIntVector.
-----------------------
Calling
SetIntVector(Number : Word; Vec : Pointer);
Purpose
Refer to your Borland Pascal 7.0 manual for the purpose and description on
SetIntVec. Theese two procedures are equal, but SetIntVector is about 50 %
faster.
Function SetMaxFilesOpen.
-------------------------
Calling
Test:=SetMaxFilesOpen(Files : Byte) : Boolean;
Purpose
Tries to re-config your system-setup and ir returns TRUE if Files now will
be the maximum of open files.
Function SetVolLabel.
---------------------
Calling
Test:=SetVolLabel(Dr : Char; VL1, VL2 : Word) : Boolean;
Purpose
SetVolLabel will try to enter a new volume label on the disk in drive Dr.
The volume label is two hex-words: VL1 and VL2. If SetVolLabel returns
TRUE, it has succeeded.
┌──────────────────────────────────────────────────────────────────────────────┐
│ Turbo Development Library V. 4.00 Chapter 14 UNIT TDCACHE │
└──────────────────────────────────────────────────────────────────────────────┘
┌[ Notice ]────────────────────────────────────────────────────────────────────┐
│ TdCache commands are over 100 % faster than the original file handle com- │
│ mands of Borland Pascal 7.0. │
│ TdCache can maximum have four open cached files. The minimum cachesize is │
│ 1024 bytes (1 Kb) and the maximum cachesize is 63488 bytes (62 Kb). │
│ The variable cIOResult takes care of the results of the TdCache. │
└──────────────────────────────────────────────────────────────────────────────┘
Procedure cAppend.
------------------
Calling
cAppend(Var Nr : cFile; FName : String);
Purpose
Opens the file FName and the file pointer is set to endposition.
Procedure cClose.
-----------------
Calling
cClose(Nr : cFile);
Purpose
Closes the file Nr and deallocates all memory used with the handle of that
file.
Function cEOF.
--------------
Calling
Test:=cEOF(Nr : cFile) : Boolean;
Purpose
Returns TRUE if the filepointer is at the last position of the file Nr. If
not it returns FALSE.
Procedure cErase.
-----------------
Calling
cErase(FName : String);
Purpose
Deletes the file FName from the disk. Please notice the file FName must be
cAssigned.
Function cFilePos.
------------------
Calling
Position:=cFilePos(Nr : cFile) : LongInt;
Purpose
Returns the current filepointers position in the file Nr.
Function cFileSize.
-------------------
Calling
Size:=cFileSize(Nr : cFile) : LongInt;
Purpose
Returns the current size of the file Nr in bytes.
Function cOpen.
---------------
Calling
OpFile:=cOpen(FName : String; Task : tOpenType; CacheAmount : Word) : Byte;
Purpose
Opens a file FName with the specified operations in Task. CacheAmount can hold
any number from 1024 to 63488 and specifies the amount of bytes that will be
used as direct memory cache.
Task can only hold the constants coRewrite, coReset or coAppend.
Procedure cRead.
----------------
Calling
cRead(Nr : cFile; Var Value : Byte);
Purpose
cRead is reading one byte from the file Nr on its current position and increa-
sing the filepointer with one.
Procedure cReadBit.
-------------------
Calling
cReadBit(Nr : cFile; Var Value : Byte; Size : tBitSize);
Purpose
cReadBit reads from file Nr's current bitposition Size (1 to 8) bits into
the variable Value.
Procedure cReadEXT.
-------------------
Calling
cReadEXT(Nr : cFile; Var Value; L : Word);
Purpose
cReadEXT reads L bytes from file Nr's current position into the variable
Value, then the filepointer is increased with L.
Procedure cReset.
-----------------
Calling
cReset(Var Nr : cFile; FName : String);
Purpose
Opens the file FName and sets the filepointer to the first position in the
file.
Procedure cRewrite.
-------------------
Calling
cRewrite(Var Nr : cFile; FName : String);
Purpose
Opens a new file FName. If a file with the same name exists same place on your
disk it is deleted withour further warnings.
Procedure cSeek.
----------------
Calling
cSeek(Nr : cFile; Pos : LongInt);
Purpose
Sets the filepointer in file Nr to position Pos. The first position in a file
is always zero.
Procedure cSeekBit.
-------------------
Calling
cSeekBit(Nr : cFile; Bit : tBitPos);
Purpose
Sets the bit position in file Nr on bit 0 to 7.
Procedure cWrite.
-----------------
Calling
cWrite(Nr : cFile; Value : Byte);
Purpose
Writes in file Nr on current fileposition the value of byte and increases the
filepointer with one.
Procedure cWriteBit.
--------------------
Calling
cWriteBit(Nr : cFile; Value : Byte; Size : tBitSize);
Purpose
cWriteBit writes Size (1 to 8) to file Nr at the current bit position.
Procedure cWriteEXT.
--------------------
Calling
cWriteEXT(Nr : cFile; Var Value; L : Word);
Purpose
cWriteEXT writes the contents of the variable Value with the length L in the
file Nr at it's current fileposition. The filepointer is then increased with
L.
┌──────────────────────────────────────────────────────────────────────────────┐
│ Turbo Development Library V. 4.00 Chapter 15 UNIT TDMENUB │
└──────────────────────────────────────────────────────────────────────────────┘
Procedure DefaultBoxMenu.
-------------------------
Calling
DefaultBoxMenu;
Purpose
DefaultBoxMenu simply rewrites the menu text that was established with the
last call to InitBoxMenu.
Think of DefaultBoxMenu as a repait kit to use whenever you have cleared
the screen or written over the menu during the processing of your program.
Procedure InitBoxMenu.
----------------------
Calling
InitBoxMenu(X, Y : Integer; MenuStr : String[80]);
Purpose
InitBoxMenu is the initialization procedure for GetFromBoxMenu, a pop-up
menu procedure. InitBoxMenu locates the menu on the screen, initializes
the menu choices to be displayed and writes the menu on the screen.
The menu will pop-up on the screen at the position you pick.
In the String[80] the rules are that each seperate menu choice must begin
with an unique capital letter and be terminated by a slash (/) delimiter.
For example the MenuStr 'Load/Save/Quit/' will set up the following three
choices:
╔═════════╗
║ Load ║
║ Save ║
║ Quit ║
╚═════════╝
Function GetFromBoxMenu.
------------------------
Calling
Choice:=GetFromBoxMenu : Char;
Purpose
GetFromBoxMenu allows the user to play with a menu initialized proviously
with InitBoxMenu and returns the user's menu pick in form of a unique
character. GetFromBoxMenu will highlight the current menu pick with a
reverse-video bar cursor. The user may move the cursor up and down with
the arrow keys. The user may select a choice on the menu by placing the
cursor on a choice and hitting enter key or by hitting the key that is the
first letter of his choice.
┌──────────────────────────────────────────────────────────────────────────────┐
│ Turbo Development Library V. 4.00 Chapter 16 UNIT TDMENU1 │
└──────────────────────────────────────────────────────────────────────────────┘
Procedure Default123Menu.
-------------------------
Calling
Default123Menu;
Purpose
Default123Menu simply rewrites the menu text that was established with the
last call to Init123Menu.
Think of Default123Menu as a repait kit to use whenever you have cleared
the screen or written over the menu during the processing of your program.
Procedure Init123Menu.
----------------------
Calling
Init123Menu(X, Y : Integer; MenuStr : String[80]);
Purpose
Init123Menu is the initialization procedure for GetFrom123Menu, a Lotus 123
style horizontal, reverse-video-bar-cursor menu procedure. Init123Menu lo-
cates the menu on the screen, initializes the menu choices to be displayed
and writes the screen. The menu will be displayed horizontal on the line you
pick.
The String[80] MenuStr contains the menu choices to be displayed. Notice
as this routine (as TDL Pull Down and Box menus) uses the first character
of every choice as reference, DO NOT include menu choices with the same first
character. Each menu choice must me separated with a slash (/), and the last
choice must be ended with a slash too.
To initialize a 123-like menu with the choices
[ Save Load About Quit ]
at position 20,1 on the screen use:
Init123Menu(20, 1, 'Save/Load/About/Quit/');
Function GetFrom123Menu.
------------------------
Calling
Choice:=GetFrom123Menu : Char;
Purpose
GetFrom123Menu allows the user to play with a menu initialized proviously
with Init123Menu and returns the user's menu pick in form of a unique
character. GetFrom123Menu will highlight the current menu pick with a
Lotus-123 reverse-video bar cursor. The user may move the cursor left and
right with the arrow keys. The user may select a choice on the menu by pla-
cing the cursor on a choice and hitting enter key or by hitting the key
that is the first letter of his choice.
┌──────────────────────────────────────────────────────────────────────────────┐
│ Turbo Development Library V. 4.00 Chapter 17 UNIT TDMENUP │
└──────────────────────────────────────────────────────────────────────────────┘
Function GetFromPullMain.
-------------------------
Calling
Main:=GetFromPullMain : Char;
Purpose
GetFromPullMain allows the user to play with the main menu and make his
choice. When the user makes a menu by hitting the enter key or the first
letter of a pick, the function will terminate and return to the calling
program the first letter (always capitalized) of the chosen menu item.
Function GetFromPullSub.
------------------------
Calling
Sub:=GetFromPullSub(SubMenu : Integer) : Char;
Purpose
When the user has picked a sub menu on the main menu, he is allowed to
pick an item from the sub menu with this function.
Procedure InitPullMain.
-----------------------
Calling
InitPullMain(MenuStr : String[80]);
Purpose
InitPullMain is the initialization procedure for the function GetFromPull-
Main. The String[80] contains the choices of the main menu. Each choice
must begin with a capital letter and be terminated by the delimiter slash
(/). For example if MenuStr were given the value 'Files/Search/Quit/'
InitPullMain would set up the three main menu choices horizontal on top of
your screen:
[ Files Search Quit ]
The first capital letter in each menu choice is important because that letter
will become the shorecut keystroke for choosing the menu item directly. So
don't begin two menu choices with the same letter.
Procedure InitPullSub.
----------------------
Calling
InitPullSub(SubMenu : Integer; MenuStr : String[80]);
Purpose
InitPullSub is the initialization procedure for the function GetFromPullSub.
The String[80] contains the choices of the sub menu number SubMenu, begin-
ning with number one.
Still remember the delimiter slash (/) and start each item in a sub menu
with a differebt capital letter.
For Example if MenuStr in main menu is like the example in InitPullMain and
MenuStr in the SubMenu 1 is 'Load/Save/Dir/Quit/' InitPullSub and InitPull-
Main would set up this menu:
[ Files Search Quit ]
| Load |
| Save |
| Dir |
| Quit |
Procedure RebuildIt.
--------------------
Calling
RebuildIt;
Purpose
The procedure RebuildIt will rebuild the menu bar on your screen, in case
of a cleared screen or an overwritten menu bar.
Procedure RecallDesktop.
------------------------
Calling
RecallDesktop;
Purpose
RecallDesktop recalls a previously saved desktop to it's original look.
Procedure RewritePullMain.
--------------------------
Calling
RewritePullMain;
Purpose
RewritePullMain does nothing more than rewriting the main menu bar hori-
zontal on top of the screen.
Procedure RewritePullSub.
-------------------------
Calling
RewritePullSub(PullSub : Integer);
Purpose
RewritePullSub rewrites the given sub menu.
Procedure SaveDesktop.
----------------------
Calling
SaveDesktop;
Purpose
SaveDesktop saves the desktop look in your memory for later to rewrite
it with the procedure RecallDesktop.
┌──────────────────────────────────────────────────────────────────────────────┐
│ Turbo Development Library V. 4.00 Chapter 18 UNIT TDCANON │
└──────────────────────────────────────────────────────────────────────────────┘
┌──────────────────────────────────────────────────────────────────────────────┐
│ This Unit should work with all Canon BJ & compatible printers. │
└──────────────────────────────────────────────────────────────────────────────┘
Function CSetPrintMode.
-----------------------
Calling
Test:=CSetPrintMode : Boolean;
Purpose
To set the printing mode on your Canon BJ & Compatible printer. Mode 0-11
are legal. Refer to your printers manual for the codes.
--------------------------------------------------------------------------------
The following constants are to be included in your printer operations e.g.
WriteLn(Lst, CFatOn+'This Text Is Fat'+CFatOff+', And This Is Not.');
The constants may be combined as you wish.
--------------------------------------------------------------------------------
CUnderOn CUnderOff Turn On / Off underlining.
CFatOn CFatOff Turn On / Off fat printing.
CShadowOn CShadowOff Turn On / Off shadow printing.
CSuperOn Turn On super script printing.
CSubOn Turn On sub script printing.
CSSOff Turn Off super or sub script printing.
CUniDirOn CUniDirOff Turn On / Off uni directional printing.
CWideOn CWideOff Turn On / Off wide printing.
COverOn COverOff Turn On / Off overlining.
CCharOne Select charset number one.
CCharTwo Select charset number two.
CPrestige Select prestige charset.
COffLine Turns the printer Off Line.
CReset Resets your printer to default.
┌──────────────────────────────────────────────────────────────────────────────┐
│ Turbo Development Library V. 4.00 Chapter 19 UNIT TDEPSON │
└──────────────────────────────────────────────────────────────────────────────┘
┌──────────────────────────────────────────────────────────────────────────────┐
│ This unit should work with all Epson & compatible printers. │
└──────────────────────────────────────────────────────────────────────────────┘
Function ESetNlqMode.
---------------------
Calling
Test:=ESetNlqMode(Mode : Byte) : Boolean;
Purpose
To set the current Near-Letter-Quality mode (0-3) on your printer. Refer
to your printers manual for the description of the different modes.
If your printer supports more modes than 0, 1, 2 and 3 and you are a regis-
tered user of TDL, send your name, address and register number and write
how many modes your printer (and the make and model of printer) supports.
Then you'll recieve a free update of TDEPSON Unit.
Function ESetNationalCode.
--------------------------
Calling
Test:=ESetNationalCode(Code : Byte) : Boolean;
Purpose
To set the national code of the character set, you want your printer to
write in (0-13). Refer to your printers manual for the codes.
--------------------------------------------------------------------------------
The following constants are to be included in your printer operations e.g.
WriteLn(Lst, EFatOn+'This Text Is Fat'+EFatOff+', And This Is Not.');
The constants may be combined as you wish.
--------------------------------------------------------------------------------
ESmallOn ESmallOff Turn On / Off small printing.
EReset Reset your printer to default.
EUnderOn EUnderOff Turn On / Off underlining.
EItalicOn EItalicOff Turn On / Off italic writing.
EFatOn EFatOff Turn On / Off fat printing.
EShadowOn EShadowOff Turn On / Off shadow printing.
EEliteOn Turn On elite printing.
EPicaOn Turn On pica printing.
ESuperOn Turn On super script printing.
ESubOn Turn On sub script printing.
ESSOff Turn Off super or sub script printing.
EUniDirOn EUniDirOff Turn On / Off uni directional printing.
EWideOn EWideOff Turn On / Off wide printing.
EOverOn EOverOff Turn On / Off overlining.
EStandard Loads standard charset.
EIBM Loads IBM charset.
EHeightOn EHeightOff Turn On / Off heigh chars printing.
ENlqOn ENlqOff Turn On / Off near-letter-quality.
┌──────────────────────────────────────────────────────────────────────────────┐
│ Turbo Development Library V. 4.00 Chapter 21 UNIT TDSTRING │
└──────────────────────────────────────────────────────────────────────────────┘
Turbo Pascal limits strins to a maximum of 255 characters. While this is
long enough for most strings, there are times when you will need longer
strings. The procedures in this unit allows you to define strings up to
32.767 characters long. The procedures assume a record type that includes
an integer field, which keeps track of the string length, and an array of
characters.
To initialize a BigString, always follow this procedure:
Const MaxBigStringLen = 2000; { Max. 2000 chars in each string }
Type BigString = Record
Length : Integer;
Ch : Array[1..MaxBigStringLen] of Char;
End;
The type BigString can hold up to 2000 characters in this example, but can
easily be modified by the programmer.
The procedures and functions in this unit mimic the standard Turbo Pascal
string commands; they use the same syntax and names, but begin with the
word "Big". For example, the equivalent of Turbo Pascal's Insert command
is the BigInsert command.
Procedure SetBigString.
-----------------------
Calling
SetBigString(Var St1 : BigString; S : String);
Purpose
SetBigString initializes a big string, St1, to a value specified in para-
meter s.
Procedure BigConcat.
--------------------
Calling
BigConcat(Var St1 : BigString; St2 : BigString);
Purpose
TDString's big strings cannot use the Turbo Pascal concatenation operator
+. You can, however, simulate the Concat command, as shown in the procedu-
re BigConcat, which concantenates St2 to St1.
Procedure BigInsert.
--------------------
Calling
BigInsert(Var St1, St2 : BigString; P : Integer);
Purpose
BigInsert inserts one BigString inside a target BigString starting at cha-
racter P.
Procedure BigDelete.
--------------------
Calling
BigDelete(Var St1 : BigString; P, Len : Integer);
Purpose
BigDelete removes characters from a BigString starting at character P. It
deletes as many characters as specified in the parameter Len.
Function BigPos.
----------------
Calling
Position:=BigPos(Var St1, St2 : BigString) : Integer;
Purpose
The function BigPos returns the position of one BigString inside another
BigString. To indicate the position, BigPos returns a positive number; if
no match is found, it returns 0.
Function BigLength.
-------------------
Calling
Length:=BigLength(Var St1 : BigString) : Integer;
Purpose
The function BigLength returns an Integer with the length of a BigString.
Procedure BigCopy.
------------------
Calling
BigCopy(Var St1, St2 : BigString; P, Len : Integer);
Purpose
Because the Turbo Pascal string function Copy cannot be directly duplica-
ted for large strings (Turbo Pascal cannot define a function using a Re-
cord data type) you must use BigCopy, which provides a result in the form
of a propcedure. BigCopy takes Len characters from St1, starting from cha-
racter P, and assigns them to St2.
╔══════════════════════════════════════════════════════════════════════════════╗
║ ║
║ Turbo Development Library V. 4.00 Registration Form. ║
║ ---------------------------------------------------- ║
║ ║
║ Yes, I would like to become a registered user of Turbo Development Library ║
║ Version 4.00 for Borland Pascal 7.0 DOS, and recieve TDL 4.00 with printed ║
║ manual, the first upgrade FREE and licence to low-cost future upgrades. ║
║ ║
║ I understand, I must enclose a checque made payable to: ║
║ Dan Consult ║
║ Provst Dreslersvej 87 ║
║ DK-9900 Frederikshavn ║
║ ║
║ Prices, incl. delivery, are: _____ ║
║ Scandinavia 298.00 DKr |_____| ║
║ Germany 89.00 DMark |_____| Please ║
║ UK 39.00 UK£ |_____| Check ║
║ USA 49.00 US$ |_____| One ! ║
║ Rest Of World 49.00 US$ |_____| ║
║ ║
║ ║
║ Company:___________________________________________________________ ║
║ ║
║ Name:______________________________________________________________ ║
║ ║
║ Title:____________________ Department:_____________________________ ║
║ ║
║ Address:___________________________________________________________ ║
║ ║
║ Town:______________________________________________________________ ║
║ ║
║ Country:___________________________________________________________ ║
║ ║
║ ║
║ _____________________ _________________ _______________________ ║
║ Place Date Signed ║
║ ║
║ ║
║ Please mail to: Dan Consult dept S.P. ║
║ Provst Dreslersvej 87, 1h ║
║ 9900 Frederikshavn ║
║ Denmark ║
║ ║
╚══════════════════════════════════════════════════════════════════════════════╝